package org.langqiao.string;

/**
 * 
 */

public class TestFinalStr{
	private final char values[];
	
	TestFinalStr(char[] value) {
		values = value;
	}
	
	public static void main(String[] args) {
		TestFinalStr test = new TestFinalStr(new char[]{'1','2','3'});
		System.out.println(test.values); // 123
		test.values[0] = '2';
		System.out.println(test.values); // 223
		// 下面的做法会出错，试图改变final修饰对象的地址
		// test.values = new char[]{'1','2','3'}; 
	}

}
